package xyz.zyl2020.juc.thread;

/**
 * @author ZhuYinglong
 * @date 2020/10/7 0007
 */
public class ThreadDemo1 extends Thread {

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName());
    }

    public static void main(String[] args) {

        new ThreadDemo1().start();

        ThreadDemo1 thread = new ThreadDemo1();
        thread.setName("myThread-1"); // 通过Thread类提供方法设置线程名称
        thread.start();
    }
}
